package UnitTestClasses;

import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ModelLayer.*;
import DBLayer.*;

public class EmployeeDBTest {
	
	EmployeeDB dbe = new EmployeeDB();

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetAllEmployees() {
		ArrayList<Employee> emp = dbe.getAllEmployees(false);
	    System.out.println(emp.size());
	}

	@Test
	public void testFindEmployee() {
		Employee emp = dbe.findEmployee(1, false);
		System.out.println(emp.getName());
	}

	@Test
	public void testSearchEmployeeName() {
		Employee emp = dbe.searchEmployeeName("Christian", false);
		System.out.println(emp.getName() + " " + emp.getAddress());
	}

	@Test
	public void testSearchEmployeeLoginName() {
		Employee emp = dbe.searchEmployeeLoginName("Mike", false);
		System.out.println(emp.getName() + " " + emp.getAddress());
	}

	/*@Test
	public void testInsertEmployee() throws Exception {
		Employee empObj = new Employee("Johnny Logan", "Onsild Byvej 4", 6000, "Kolding", 98187788, "johnny@logan.dk", "Bartender", "logan", 80000);
		dbe.insertEmployee(empObj);
	}*/

/*	@Test
	public void testUpdateEmployee() {
		Employee empObj = new Employee(11, "Johnny Logansen", "Onsild Byvej 4", 6000, "Kolding", 98187788, "johnny@logan.dk", "Bartender", "logan", 80000);
		dbe.updateEmployee(empObj);
	}*/
/*	
	@Test
	public void testDeleteEmployee() {
		ArrayList<Employee> emp = dbe.getAllEmployees(false);
		System.out.println(emp.size());
		dbe.deleteEmployee(11);
		ArrayList<Employee> emps = dbe.getAllEmployees(false);
		System.out.println(emps.size());
	}*/

}
